-
Notifications
You must be signed in to change notification settings - Fork 8
feat: new push/pull #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: new push/pull #243
Conversation
44ed94c to
75ef16d
Compare
Signed-off-by: Timur Tuktamyshev <[email protected]>
75ef16d to
bb25803
Compare
Signed-off-by: Timur Tuktamyshev <[email protected]>
Signed-off-by: Timur Tuktamyshev <[email protected]>
Signed-off-by: Timur Tuktamyshev <[email protected]>
Signed-off-by: Timur Tuktamyshev <[email protected]>
Signed-off-by: Timur Tuktamyshev <[email protected]>
Signed-off-by: Timur Tuktamyshev <[email protected]>
Signed-off-by: Timur Tuktamyshev <[email protected]>
…-push Signed-off-by: Pavel Okhlopkov <[email protected]>
Signed-off-by: Pavel Okhlopkov <[email protected]>
Signed-off-by: Pavel Okhlopkov <[email protected]>
Signed-off-by: Pavel Okhlopkov <[email protected]>
Signed-off-by: Pavel Okhlopkov <[email protected]>
Signed-off-by: Pavel Okhlopkov <[email protected]>
7071ee0 to
4106fc2
Compare
Signed-off-by: Timur Tuktamyshev <[email protected]>
4106fc2 to
89a83d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a new unified pull/push mechanism for mirror operations, activated via the NEW_PULL=true environment variable. The key architectural change is eliminating path transformations - the local OCI layout structure now directly mirrors the registry structure, making the push/pull operations simpler and more reliable.
Changes:
- New unified push service that automatically discovers and pushes all OCI layouts based on their directory structure
- Refactored module extra images to use separate layouts per extra image type instead of a shared layout
- Added
--ignore-suspendflag to bypass suspended release channel checks - Added graceful shutdown handling with signal capture for Ctrl+C interruption
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/mirror/push.go | New push service implementation that walks directory tree and pushes layouts based on relative paths |
| internal/mirror/pusher/pusher.go | Refactored pusher service with simplified layout pushing logic |
| internal/mirror/modules/modules.go | Enhanced module pulling to support per-extra-image layouts, internal digest images, and release versions |
| internal/mirror/modules/layout.go | Changed extra images from single layout to map of layouts per extra image name |
| internal/mirror/platform/platform.go | Added IgnoreSuspend option and version tags to release-channel |
| internal/mirror/platform/layout.go | Added version tags to DeckhouseReleaseChannel download list |
| internal/mirror/puller/puller.go | Added digest reference handling for images with @sha256: format |
| internal/mirror/puller/types.go | Simplified SplitImageRefByRepoAndTag by removing special digest handling |
| internal/mirror/security/security.go | Changed layout creation path from nested to root-based |
| internal/mirror/cmd/push/push.go | Added new push execution path using NEW_PULL environment variable |
| internal/mirror/cmd/pull/pull.go | Added signal handling and IgnoreSuspend parameter passing |
| internal/mirror/cmd/pull/flags/flags.go | Added --ignore-suspend flag |
| internal/mirror/releases/versions.go | Fixed typo in function name and re-enabled suspend check with override |
| internal/mirror/releases/versions_test.go | Fixed typo in test function names |
| pkg/libmirror/bundle/bundle.go | Added PackWithPrefix to support prefixed tar paths |
| pkg/libmirror/layouts/push.go | Refactored push logic to use config struct and improved logging |
| pkg/libmirror/operations/params/pull.go | Added IgnoreSuspend parameter |
| pkg/libmirror/util/retry/retry.go | Made RunTaskWithContext private (renamed to runTaskWithContext) |
| pkg/registry/service/module_service.go | Added ExtraImage method for scoped extra image services |
| internal/mirror.go | Removed MirrorTypeModulesExtra enum value |
| internal/layout.go | Updated path mappings and documentation for module layouts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Unified Pull/Push Mechanism for Mirror Operations
Summary
This PR introduces a new unified pull/push mechanism activated via
NEW_PULL=trueenvironment variable. The key principle is no path transformations - the local OCI layout structure directly mirrors the registry structure.Changes
New Push Service (
internal/mirror/push.go)index.jsondeckhouse/modules:<module-name>tags) for module discoveryTesting
Verified full parity between old and new mechanisms:
deckhouseanddeckhouse-etaloninstall,install-standalone,release-channeltrivy-db,trivy-bdu, etc.Usage
Pull with new mechanism
NEW_PULL=true d8 mirror pull ...
Push with new mechanism
NEW_PULL=true d8 mirror push ...
Migration
The new mechanism is opt-in via environment variable. Existing behavior is unchanged when
NEW_PULLis not set.